<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改过程信息')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-attr-edit" th:object="${itemAttr}">
            <input name="objectId" th:field="*{objectId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">父对象id：</label>
                <div class="col-sm-8">
                    <div class="input-group">
                        <input id="treeId" name="parentId" type="hidden" th:field="*{parentId}" />
                        <input class="form-control" type="text" onclick="selectAttrTree()" id="treeName" readonly="true" th:field="*{parentName}">
                        <span class="input-group-addon"><i class="fa fa-search"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">对象类型：</label>
                <div class="col-sm-8">
                    <input name="objectType" th:field="*{objectType}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">对象名称：</label>
                <div class="col-sm-8">
                    <input name="objectName" th:field="*{objectName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">优先级：</label>
                <div class="col-sm-8">
                    <select name="priority" class="form-control m-b" th:with="type=${@dict.getType('item_attribute_priority')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{priority}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">IP地址：</label>
                <div class="col-sm-8">
                    <input name="ipAddress" th:field="*{ipAddress}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">域名：</label>
                <div class="col-sm-8">
                    <input name="domainName" th:field="*{domainName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">端口：</label>
                <div class="col-sm-8">
                    <input name="ipPort" th:field="*{ipPort}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">服务：</label>
                <div class="col-sm-8">
                    <input name="service" th:field="*{service}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">版本信息：</label>
                <div class="col-sm-8">
                    <input name="version" th:field="*{version}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">访问方式：</label>
                <div class="col-sm-8">
                    <textarea name="uri" class="form-control">[[*{uri}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">控制台类型：</label>
                <div class="col-sm-8">
                    <select name="consoleType" class="form-control m-b" th:with="type=${@dict.getType('item_attribute_console_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{consoleType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">下载地址：</label>
                <div class="col-sm-8">
                    <textarea name="download" class="form-control">[[*{download}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">账号口令：</label>
                <div class="col-sm-8">
                    <textarea name="accountPass" class="form-control">[[*{accountPass}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">登录点：</label>
                <div class="col-sm-8">
                    <textarea name="loginFace" class="form-control">[[*{loginFace}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">登录方式：</label>
                <div class="col-sm-8">
                    <textarea name="loginMode" class="form-control">[[*{loginMode}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">风险等级：</label>
                <div class="col-sm-8">
                    <select name="riskLevel" class="form-control m-b" th:with="type=${@dict.getType('item_attribute_risk_level')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{riskLevel}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">验证情况：</label>
                <div class="col-sm-8">
                    <select name="verification" class="form-control m-b" th:with="type=${@dict.getType('item_attribute_verification')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{verification}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">后渗透对象访问方式：</label>
                <div class="col-sm-8">
                    <textarea name="afterObject" class="form-control">[[*{afterObject}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">敏感度：</label>
                <div class="col-sm-8">
                    <select name="sensitivity" class="form-control m-b" th:with="type=${@dict.getType('item_attribute_sensitivity')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sensitivity}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">数据规模：</label>
                <div class="col-sm-8">
                    <input name="dataSize" th:field="*{dataSize}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "system/attr";
        $("#form-attr-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-attr-edit').serialize());
            }
        }

        /*过程信息-新增-选择父部门树*/
        function selectAttrTree() {
            var options = {
                title: '过程信息选择',
                width: "380",
                url: prefix + "/selectAttrTree/" + $("#treeId").val(),
                callBack: doSubmit
            };
            $.modal.openOptions(options);
        }

        function doSubmit(index, layero){
            var body = layer.getChildFrame('body', index);
               $("#treeId").val(body.find('#treeId').val());
               $("#treeName").val(body.find('#treeName').val());
               layer.close(index);
        }
    </script>
</body>
</html>